package com.my.study;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication
@EnableScheduling
@MapperScan(value = "com.my.study.mapper")
// com.my.study.entity.enums 和 com.my.study.entity 下的类都不会被扫描
@ComponentScan(basePackages = {"com.my.study"},
        excludeFilters = {@ComponentScan.Filter(type = FilterType.REGEX, pattern = "com.my.study.entity\\..*"),
                @ComponentScan.Filter(type = FilterType.REGEX, pattern = "com.my.study.enums\\..*")})
@Slf4j
@EnableDiscoveryClient //服务发现
public class ApplicationMain {

    public static void main(String[] args) {
        SpringApplication.run(ApplicationMain.class, args);
    }
}
